% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_acs-poststrat.R
\name{get_poststrat}
\alias{get_poststrat}
\title{Formats a post-strat table from ACS and district-level data}
\usage{
get_poststrat(cleaned_acs, dist_data = NULL, formula)
}
\arguments{
\item{cleaned_acs}{An output of \link{get_acs_cces}. The count of people in
each cell must be under the variable \code{count}}

\item{dist_data}{District-level (in this case congressional district-level) information
to merge in}

\item{formula}{the model formula used to fit the multilevel regression model, with one
term on the LHS: e.g. \code{y ~ x1 + x2 + (1|x3)}.
Only the RHS will be used but the LHS is necessary for now.}
}
\description{
Formats a post-strat table from ACS and district-level data
}
\examples{
\dontrun{
 fm_brm <- response ~  age + gender + educ + pct_trump + (1|cd)
 acs_tab <- get_acs_cces(
              varlist = acscodes_age_sex_educ,
              varlab_df = acscodes_df,
             year = 2018)

poststrat <-  get_poststrat(acs_tab, cd_info_2018, fm_brm)
head(poststrat)
#   age            gender educ       pct_trump cd    count
#   <fct>          <fct>  <fct>          <dbl> <chr> <dbl>
# 1 18 to 24 years Male   HS or Less     0.049 NY-15 24216
# 2 18 to 24 years Male   HS or Less     0.054 NY-13 18014
# 3 18 to 24 years Male   HS or Less     0.068 CA-13 14153
# 4 18 to 24 years Male   HS or Less     0.07  PA-03 15750
# 5 18 to 24 years Male   HS or Less     0.087 CA-12  6270
# 6 18 to 24 years Male   HS or Less     0.092 IL-07 18734
}

}
\seealso{
\link{get_acs_cces}
}
